package com.demo.security;

import org.springframework.security.crypto.password.PasswordEncoder;

public class SimplePasswordEncoder  implements PasswordEncoder {
    @Override
    public String encode(CharSequence charSequence) {
        System.out.println("SimplePasswordEncoder - 加密邏輯執行");
        return new String(charSequence.toString());
    }

    @Override
    public boolean matches(CharSequence charSequence, String s) {
        System.out.println("SimplePasswordEncoder - 密碼匹配邏輯執行");
        return s.equals(encode(charSequence));
    }
}
